<?php $titledata = array(
              'name'        => 'title',
              'id'          => 'title',
              'value'       => '',
              'maxlength'   => '127',
              'size'        => '50',
              'style'       => 'width:50%',
			  'value'		=> $title
            );?>
            
<?php $textdata = array(
              'name'        => 'text',
              'id'          => 'text',
              'value'       => '',
              'rows'		=> '25',
              'style'       => 'width:95%;',
			  'value'		=> $text
            );?>            
            
<div id="main_content">
	<h1>Edit Article</h1>
	<p>
		<?php echo form_open('articles/updateArticle','',array('articleid'=>$articleid));?>
		<?php echo "<a href=".base_url().'userimages/'.$img.'>'."<img src=".base_url().'userimages/thumbs/'.$img_thumb.' border="0"'.'></a>';?>
		<p>
			<?php echo form_label('Title: ', 'title'); ?>
			</br>
			<?php echo form_input($titledata)?>
		</p>
		<p>
			<?php echo form_label('Category: ', 'category'); ?>
			</br>
			<select name="category">
				<?php foreach ($categories as $category) : ?>
				<?php if($category->articleCategoryID == $current_categoryID):?>
				<option value="<?php echo $category->articleCategoryID ?>" <?php echo set_select('myselect', $category->articleCategoryID, TRUE); ?> ><?php echo $category->name ?></option>
				<?php else:?>
				<option value="<?php echo $category->articleCategoryID ?>" <?php echo set_select('myselect', $category->articleCategoryID); ?> ><?php echo $category->name ?></option>
				<?php endif;?>
				<?php endforeach; ?>
			</select>
		</p>
		<p>
			<?php echo form_label('Text: ', 'text'); ?>
			</br>
			<?php echo form_js_editor($textdata, $text)?>
		</p>	
		
		<!-- <p class="new_article_buttons">
			<?php //echo form_submit('submit', 'Submit')?>
			<?php //echo form_reset('reset', 'Clear')?>
		</p> -->
		<?php echo validation_errors();?>
		<?php echo form_close(); ?>
			
	</p>
</div>